package com.fz.us.oa.core.entity.com;

import com.fz.us.admin.company.entity.BaseFlowEntity;
import com.fz.us.admin.company.entity.Department;
import com.fz.us.admin.company.entity.Post;
import com.fz.us.admin.company.entity.User;

import javax.persistence.*;

/**
 * Created by ZhuChunXiao on 2017/5/18.
 * 人事主表 基本信息
 */
@Entity
@Table(name="ec_personnelinfo")
public class PersonnelInfo extends BaseFlowEntity {
    private static final long serialVersionUID = 3387496711813369766L;

    /**
     * 性别 1男 2女
     */
    private int sex;
    /**
     * 年龄
     */
    private int age;
    /**
     * 身份证号
     */
    private String cardId;
    /**
     * 部门
     */
    private Department department;
    /**
     * 岗位
     */
    private Post post;
    /**
     * 移动电话
     */
    private String phone;
    /**
     * 电子邮件
     */
    private String email;
    /**
     * 员工性质 1正式 2试用
     */
    private int nature;
    /**
     * 是否即将到期
     */
    private boolean expire;
    /**
     * 是否离职
     */
    private boolean quit;
    /**
     * 个人信息表
     */
    private PersonnelSelf personnelSelf;
    /**
     * 用工信息表
     */
    private PersonnelUse personnelUse;
//    /**
//     * 奖惩信息表
//     */
//    private List<PersonnelReward> personnelRewardList;
    /**
     * 关联的用户
     */
    private User user;
    /**
     * 月份
     */
    private int month;


    public int getSex() {
        return sex;
    }

    public void setSex(int sex) {
        this.sex = sex;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getCardId() {
        return cardId;
    }

    public void setCardId(String cardId) {
        this.cardId = cardId;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    public Department getDepartment() {
        return department;
    }

    public void setDepartment(Department department) {
        this.department = department;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    public Post getPost() {
        return post;
    }

    public void setPost(Post post) {
        this.post = post;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public int getNature() {
        return nature;
    }

    public void setNature(int nature) {
        this.nature = nature;
    }

    public boolean isExpire() {
        return expire;
    }

    public void setExpire(boolean expire) {
        this.expire = expire;
    }

    @Column(columnDefinition = "tinyint(1) default 0")
    public boolean isQuit() {
        return quit;
    }

    public void setQuit(boolean quit) {
        this.quit = quit;
    }

    @OneToOne(fetch = FetchType.LAZY)
    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public int getMonth() {
        return month;
    }

    public void setMonth(int month) {
        this.month = month;
    }


    @OneToOne(fetch = FetchType.LAZY)
    public PersonnelSelf getPersonnelSelf() {
        return personnelSelf;
    }

    public void setPersonnelSelf(PersonnelSelf personnelSelf) {
        this.personnelSelf = personnelSelf;
    }

    @OneToOne(fetch = FetchType.LAZY)
    public PersonnelUse getPersonnelUse() {
        return personnelUse;
    }

    public void setPersonnelUse(PersonnelUse personnelUse) {
        this.personnelUse = personnelUse;
    }
//
//    @OneToMany(fetch = FetchType.LAZY)
//    public List<PersonnelReward> getPersonnelRewardList() {
//        return personnelRewardList;
//    }
//
//    public void setPersonnelRewardList(List<PersonnelReward> personnelRewardList) {
//        this.personnelRewardList = personnelRewardList;
//    }
}
